/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.util.List;
/*     */ import java.util.regex.Pattern;
/*     */ import net.minecraft.item.Item;
/*     */ import net.minecraft.item.ItemArmor;
/*     */ import net.minecraft.item.ItemStack;
/*     */ import net.minecraft.nbt.JsonToNBT;
/*     */ import net.minecraft.nbt.NBTBase;
/*     */ import net.minecraft.nbt.NBTException;
/*     */ import net.minecraft.nbt.NBTTagCompound;
/*     */ import net.minecraft.nbt.NBTTagString;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class eg
/*     */ {
/*     */   @eos/moe/dragoncore/t(v = {"序列化物品", "ItemStack_Serialize"})
/*     */   public static String z(ItemStack a) {
/*  22 */     NBTTagCompound nBTTagCompound = new NBTTagCompound();
/*  23 */     a.func_77955_b(nBTTagCompound);
/*  24 */     return nBTTagCompound.toString();
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"反序列化物品", "ItemStack_DeSerialize"})
/*     */   public static kd v(String a) {
/*     */     try {
/*  30 */       NBTTagCompound nBTTagCompound = JsonToNBT.func_180713_a(a);
/*  31 */       return new kd(new ItemStack(nBTTagCompound));
/*  32 */     } catch (NBTException nBTException) {
/*  33 */       return new kd(ItemStack.field_190927_a);
/*     */     } 
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品数", "ItemStack_Get_Count"})
/*     */   public static int t(ItemStack a) {
/*  39 */     return a.func_190926_b() ? 0 : a.func_190916_E();
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品名", "ItemStack_Get_Name"})
/*     */   public static String v(ItemStack a) {
/*  44 */     return a.func_190926_b() ? "" : a.func_82833_r();
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品Lore数", "ItemStack_Get_Lore_Size"})
/*     */   public static int h(ItemStack a) {
/*  49 */     List<String> list = ve.z(a);
/*  50 */     return list.size();
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品Lore", "ItemStack_Get_Lore"})
/*     */   public static String v(ItemStack a, int i, boolean bool) {
/*  55 */     List<String> list = ve.v(a, bool);
/*  56 */     if (i < 0) {
/*  57 */       i = list.size() + i;
/*     */     }
/*     */     
/*  60 */     return (list.size() >= i + 1 && i >= 0) ? list.get(i) : "";
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品所有Lore", "ItemStack_Get_All_Lore"})
/*     */   public static nf v(ItemStack a, boolean bool) {
/*  65 */     List<String> list = ve.v(a, bool);
/*  66 */     return new nf(list, false);
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品信息数", "ItemStack_Get_Info_Size"})
/*     */   public static int z(ItemStack a) {
/*  71 */     List<String> list = ve.v(a);
/*  72 */     return list.size();
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品信息", "ItemStack_Get_Info"})
/*     */   public static String v(ItemStack a, int i) {
/*  77 */     List<String> list = ve.v(a);
/*  78 */     return (list.size() >= i + 1) ? list.get(i) : "";
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品所有信息", "ItemStack_Get_All_Info"})
/*     */   public static nf v(ItemStack a) {
/*  83 */     List<String> list = ve.v(a);
/*  84 */     return new nf(list, false);
/*     */   }
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品NBT", "ItemStack_Get_NBT"})
/*     */   public static String v(ItemStack a, String str) {
/*  90 */     NBTTagCompound nBTTagCompound = a.func_77978_p();
/*  91 */     if (nBTTagCompound != null) {
/*  92 */       if (str.isEmpty())
/*  93 */         return nBTTagCompound.toString(); 
/*  94 */       String[] arrayOfString = str.split("\\.");
/*  95 */       for (int i = 0; i < arrayOfString.length - 1; i++) {
/*  96 */         nBTTagCompound = nBTTagCompound.func_74775_l(arrayOfString[i]);
/*     */       }
/*  98 */       if (arrayOfString.length > 0) {
/*  99 */         NBTBase nBTBase = nBTTagCompound.func_74781_a(arrayOfString[arrayOfString.length - 1]);
/* 100 */         if (nBTBase != null) {
/* 101 */           if (nBTBase.func_74732_a() == 8) {
/* 102 */             return ((NBTTagString)nBTBase).func_150285_a_();
/*     */           }
/* 104 */           return nBTBase.toString();
/*     */         } 
/*     */       } 
/*     */     } 
/*     */     
/* 109 */     return "";
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"匹配物品", "ItemStack_Match"})
/*     */   public static boolean v(ItemStack a, String str, o o1) {
/* 114 */     if (a.func_190926_b()) {
/* 115 */       return false;
/*     */     }
/* 117 */     if (a.func_77973_b().getRegistryName() != null && a.func_77973_b().getRegistryName().func_110623_a().contains("shulker_box")) {
/* 118 */       return false;
/*     */     }
/* 120 */     Pattern pattern = Pattern.compile(str);
/* 121 */     String str1 = ve.v(a, false, false);
/* 122 */     int i = Item.func_150891_b(a.func_77973_b());
/*     */     
/* 124 */     if ((o1 instanceof ie || i == (int)o1.v()) && ja.v(pattern, str1)) {
/* 125 */       return true;
/*     */     }
/*     */ 
/*     */ 
/*     */     
/* 130 */     return false;
/*     */   }
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取物品护甲值", "ItemStack_Get_Armor"})
/*     */   public static int v(ItemStack a) {
/* 136 */     return (a.func_77973_b() instanceof ItemArmor) ? ((ItemArmor)a.func_77973_b()).field_77879_b : 0;
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\eg.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */